import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//导入vue-table
import TreeTable from 'vue-table-with-tree-grid'

//导入字体图标
import './assets/fonts/iconfont.css'
// 导入全局样式表
import './assets/css/global.css'
//导入element
import './plugins/element.js'
//导入axios
import axios from 'axios'
//配置请求的根路径
axios.defaults.baseURL = "http://127.0.0.1:8888/api/private/v1/"
//配置axios的拦截器
axios.interceptors.request.use(config=>{
  //从sessionStorage中取出token加入到headers的自定义属性中
  config.headers.Authorization = sessionStorage.getItem('token');
  //在最后必须返回config
  return config;
})
//将axios挂载到Vue原型对象上，这样哪里都能调用axios了
Vue.prototype.$http = axios;

// 注册TreeTable
Vue.component('tree-table', TreeTable)

//注册富文本编辑器QuillEditor
import VueQuillEditor from 'vue-quill-editor'
//导入富文本编辑器QuillEditor对应的样式
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme
Vue.use(VueQuillEditor)


Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
